@extends('layout.admin')
@section('title','列表页')
@section('content')

	<!-- {{session('info')}} -->
	<!-- @if(session('info'))
	<div class="mws-form-message info">
		{{session('info')}}

	</div>
	@endif -->
	<div class="mws-panel grid_8 mws-collapsible">
    	<div class="mws-panel-header">
        	<span><i class="icon-table"></i> 用户列表</span>
        <div class="mws-collapse-button mws-inset"><span></span></div>
        </div>
        <div class="mws-panel-inner-wrap"><div class="mws-panel-body no-padding">
            <form action="/user/list">
            <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper" role="grid"><div id="DataTables_Table_0_length" class="dataTables_length"><label>
            显示 <select size="1" name="num" aria-controls="DataTables_Table_0">
            <option value="10" @if($request->input('num') == '10') selected @endif>
            10</option><option value="25" @if($request->input('num') == '25') selected @endif>
            25</option><option value="50" @if($request->input('num') == '50') selected @endif>
            50</option><option value="100" @if($request->input('num') == '100') selected @endif>
            100</option></select>
             页</label></div>

             <div class="dataTables_filter" id="DataTables_Table_0_filter">
             <label>
            	 关键字: <input type="text" value="{{$request->input('keyword')}}" name="keyword" aria-controls="DataTables_Table_0">
             	<button class="btn btn-info">搜索</button></label>
             </div>
             </form>


             <table class="mws-table mws-datatable dataTable" id="DataTables_Table_0" aria-describedby="DataTables_Table_0_info">
                <thead>
                    <tr role="row">
	                    <th class="sorting_asc" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending" style="width: 128px;">
	                    ID</th>
	                    <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending" style="width: 172px;">
	                    用户名</th>
	                    <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending" style="width: 159px;">
	                    邮箱</th>
	                    <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending" style="width: 110px;">
	                    手机号</th>
	                    <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending" style="width: 79px;">
	                    操作</th>
	                    <th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" aria-label="" style="width: 114px;"></th>
                    </tr>
                </thead>
                
            <tbody role="alert" aria-live="polite" aria-relevant="all">
            	@foreach($user as $k=>$v)
            	<tr class="@if($k%2 == 0) even @else odd @endif">
                        <td class=" sorting_1">{{$v->id}}</td>
                        <td class=" ">{{$v->username}}</td>
                        <td class=" ">{{$v->email}}</td>
                        <td class=" ">{{$v->phone}}</td>
                        <td class=" ">

                       		 <span class="btn-group">
                        	<a href="/user/edit?id={{$v->id}}" class="btn btn-small"><i class="icon-pencil"></i></a>
                            <a href="/user/delete?id={{$v->id}}" class="btn btn-small"><i class="icon-trash"></i></a>
                       		 </span>
                        </td>
                        <td class=" ">
                            <span class="btn-group">
                                <a href="#" class="btn btn-small"><i class="icon-search"></i></a>
                                <a href="#" class="btn btn-small"><i class="icon-pencil"></i></a>
                                <a href="#" class="btn btn-small"><i class="icon-trash"></i></a>
                            </span>
                        </td>
                </tr>
                @endforeach
             </tbody>
             </table>
            <!-- <div class="dataTables_info" id="DataTables_Table_0_info">
             Showing 1 to 10 of 20 entries</div>  -->
             <style type="text/css">
             #pages li{
             	background-color: #444444;
			     border-left: 1px solid rgba(255, 255, 255, 0.15);
			     border-right: 1px solid rgba(0, 0, 0, 0.5);
			     box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.5), inset 0px 1px 0px rgba(255, 255, 255, 0.15);
			      color: #fff;
			      cursor: pointer;
			      display: block;
			      float: left;
			      font-size: 12px;
			      height: 20px;
			      line-height: 20px;
			      outline:medium none;
			      padding:0 10px;
			      text-align: center;
			      text-decoration: none;

             }
             #pages .active{
             	background-color: #808080;
             	background-image: none;
             	border:medium none;
             	box-shadow: 0 0 4px rgba(0,0,0,0.25) inset;
             	color:#323232;
             }
            



             </style>

             <div class="dataTables_paginate paging_two_button" id="DataTables_Table_0_paginate">
	             <a class="paginate_disabled_previous" tabindex="0" role="button" id="DataTables_Table_0_previous" aria-controls="DataTables_Table_0">
	             Previous</a>
	             <a class="paginate_enabled_next" tabindex="0" role="button" id="DataTables_Table_0_next" aria-controls="DataTables_Table_0">
	             Next</a>
             </div>

             <div id="pages">
             	
             	{{!! $user->appends($request->only(['num','keyword']))->render() !!}}
             </div>


             		</div>
                 </div>
               </div>
            </div>
	}

@endsection
